All right.
So today I'm going to finish off my teleporter.
I'm going to add a sound effect for the teleportation process.
And I'm also going to add I'm going to change the coloring of this while we're in cooldown.
I'm going to gray it out.
So let's get our sound.
First, let's go to Toolbox Model's audio, and then I'm going to search for like a laser sound laser
charge.
Laser charge.
I want something kind of short.
I'll go with this, like two second one here.
Yeah, that'll work.
Let's go to our pad A That's this right here.
I'm going to insert it into pad A so that the sound is close to where we are, where it makes sense.
Let's call this charge.
And I also want to do one for here, Right?
So I'm going to do an alt click, select my pad B.
And then I'll just duplicate charge control d keep the same sound.
Just put it down there to pad B.
All right.
Nice.
And I want these colors to change when we're in cooldown mode.
This pad is going to be easy because we're referencing that in code already.
This color here to an alt click this.
This part here, I should say.
Unfortunately, we weren't very careful with our naming, so I'm going to change that roof to like roof
A just to give it a unique name so I could access it in the script.
Let's go to our script teleport.
Let's double click and get some references for our sounds and the parts that we want to change colors
to.
We'll do the sounds first, right?
We could do a sound.
A That's the charge.
A Right.
And that's going to be on pad a pad a charge.
I'll do a sound, B on pad B charge, and then I need that roof part.
So roof.
I'll just say roof because we only have one for the script that is going to be on script dot, parent,
dot, teleporter, a roof.
All right.
Nice.
So when we come down in here, the if statement, if it's executed, we can teleport.
The player exists after we turn teleportation process off.
But before we actually move, let's play our sound.
So I'll say sound a colon play and then let's wait until that's done playing or partially done.
So I'm going to say, Wait, I have sound.
Whoops, I spell it wrong.
Sound a dot time length that will wait for the whole time length.
If we go to our charge, this is sound a right.
Down here on timeline.
We have 1.9, 6 seconds.
You can see it's grayed out because you can't change it here, but you can see the length of time.
All right.
What I'm going to do is I'm going to leave before it's finished.
I'm going to teleport before it's finished.
I'm going to do Time's point eight.
So when this is 80% done playing, we'll go ahead and do our our translocation.
Nice.
And let's go ahead and do the same for B to C, I'm going to copy these to control C, I'm going to
do it right.
Let's see.
We got our cool down.
Yeah, I'll do it.
I'll do it above where we change the flag so people can't get in there while we're still playing our
sound.
I need to change this.
The sound be because we don't want to play the one by the green one, right?
We want to play the one in the box because that's where we're at.
And all we'll do this is going to be the same length of time.
So if you don't change this, you're not going to see anything different.
But I like to keep it the same.
Right.
All right, let's try it.
Let's run over here.
That's pretty good.
Yeah, I like it.
All right, let's change these colors now.
And then we'll get a test server so we can view it while somebody else does it.
We'll have two people playing the test server, So we'll stop this.
Let's go to our teleport.
And remember, we want to dole out our colors.
So right after we do our sound, but before we actually move, you could actually do it right after
we move to if you want, we could do that there.
Right.
But before this cooldown.
Wait, right before the cool down wait.
We'll get our pad A and then we'll change the color.
The brick color to brick color dot gray.
And then the pad a material.
It's glowing.
Right.
Let's go ahead and get the enum material.
We'll change it to boring old plastic so it doesn't glow.
And we also want to do this for the roof.
So we have the roof, which is roof, but the variable just says roof would do that.
We'll do the same order.
We'll do brick color equals brick color dot gray, and then we'll do pad a oops roof material, sorry,
rooftop material, E name material, plastic, boring old plastic.
All right.
And then when we're done, our cool down will turn these colors back on.
Right?
So this is going to gray out when we teleport copy.
And then when this gets turned to true, we'll do it right.
Like right after the teleport.
We'll make these the original colors.
We can't do the dot lime green, right?
We have to do a new.
Oh, that's lowercase, new lime green.
Right.
And then.
This is going to be neon.
This is going to be new lime green again.
Control.
See, this is the roof.
Whoops.
Control Z.
I messed up.
There you go.
And then this is going to be the neon.
All right, so that's the roof in the pad.
We're going to change the colors.
Let's try it out.
But let's try it with a test server so we can actually view it while somebody else is teleporting.
So I have the test here.
This test tab two players are selected local server start and it's going to get two copies of my games
Go game going with the same character, but twice you'll see.
All right, here we go.
We've got our test server starting up, and it's just the same copy of me twice.
But it's still convenient because you can start watching.
You can watch what the other guy is doing.
Right.
So I'm going to come over here.
This guy is going to get in the guy on my left, and we're going to watch what happens to these pads
on the right.
And the pads went gray, right?
If I click here, you can't hear this sound right.
It's a quiet sound.
Nice.
That's pretty cool.
And then the pads came back on.
I like it.